package cn.zhc.com.base;

import org.json.JSONException;
import org.json.JSONObject;

import cn.zhc.com.utils.UtilsGson;

/**
 * Created by zhouhongchun on 2017/8/14.
 * 这个适用应用于找不到对应的json bean类，需要自己去构建json时使用
 */
public class BaseForm extends JSONObject{
	public String toJson() {
		return UtilsGson.toJson(this);
	}
	public BaseForm addParam(String name, double value) throws JSONException {
		put(name, value);
		return this;
	}
	
	public BaseForm addParam(String name, float value) throws JSONException {
		put(name, value);
		return this;
	}
	
	public BaseForm addParam(String name, int value) throws JSONException {
		put(name, value);
		return this;
	}
	
	public BaseForm addParam(String name, long value) throws JSONException {
		put(name, value);
		return this;
	}
	
	public BaseForm addParam(String name, String value) throws JSONException {
		put(name, value);
		return this;
	}
	
	public BaseForm addParam(String name, boolean value) throws JSONException {
		put(name, value);
		return this;
	}
	
	public BaseForm addParam(String name, JSONObject json) throws JSONException {
		put(name, json);
		return this;
	}


}